import request from '@/utils/request'

/**
 * 获取检验项目
 * @param {Array} Search 0：检验编号 1=40 
 */
export function getTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetTestAttributes',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 数据登记获取项目
 * @param {Array} Search 0：检验编号 1=40 
 */
export function GetEasyFillRecordList(params) {
  return request({
    url: 'API/RecordReport/GetEasyFillRecordList',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 固定下拉框内容Varchar
 * @param {Object} params 
 */
export function GetDictionarySelect(params) {
  return request({
    url: 'API/BaseData/GetDictionarySelect',
    method: 'get',
    params: params
  })
}

/**
 * 规格型号
 * @param {Array} Search 
 */
export function getDictionaryByParentCode(params) {
  return request({
    url: 'API/BaseData/GetDictionaryByParentCode',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 供应商
 * @param {Array} Search 
 */
export function getCompanySelect(params) {
  return request({
    url: 'API/Company/GetCompanySelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean  
  })
}

/**
 * 提交前验证批号是否重复
 * @param {Array} Search 
 */
export function getCheckApplyBatchID(params) {
  return request({
    url: 'API/QualityTest/GetCheckApplyBatchID',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 获取当前流程是否需要验证密码
 * @param {Object} params 
 */
export function getWorkflowPassword(params) {
  return request({
    url: '/API/QualityTest/GetWorkflowPassword',
    method: 'get',
    params,
    failMsg: true
  })
}

/**
 * 单位
 * @param {Array} Search 
 */
export function getGroupDictionarySelect(params) {
  return request({
    url: 'API/BaseData/GetGroupDictionarySelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}


/**
 * 我的请验数据
 * @param {Array} Search 
 */
export function getApplyListPage(params) {
  return request({
    url: 'API/QualityTest/GetApplyListPage',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 待我采样列表
 * @param {Array} Search 
 */
export function getSampleDataPage(params) {
  return request({
    url: 'API/QualityTest/GetSampleDataPage',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}


/**
 * 撤回我的请验
 * @param {Array} Search 
 */
export function callBackApply(params) {
  return request({
    url: 'API/QualityTest/CallBackApply',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 删除我的请验
 * @param {Array} Search 
 */
export function deleteApply(params) {
  return request({
    url: 'API/QualityTest/DeleteApply',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 检验项目
 * @param {Array} Search 
 */
export function getTestStandardAttributeSelect(params) {
  return request({
    url: 'API/QualityStandard/GetTestStandardAttributeSelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}


/**
 * 申领量接口
 * @param {Array} Search 
 */
export function getStabilitySampleSelect(params) {
  return request({
    url: 'API/RetainedSample/GetStabilitySampleSelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean  
  })
}


/**
 * 来料信息
 * @param {Array} Search 
 */
export function getUnAllocationBatchIdSelect(params) {
  return request({
    url: 'API/QualityTest/GetUnAllocationBatchIdSelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: false //请求失败通知，支持String & Boolean
  })
}

/**
 * 检验项目
 * @param {Array} Search 
 */
export function getTestSampleInfo(params) {
  return request({
    url: 'API/RetainedSample/GetTestSampleInfo',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 检验项目list
 * @param {Array} Search 
 */
export function getUnAllocationTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetUnAllocationTestAttributes',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 获取检验员的list
 * @param {Array} Search 
 */
export function getClassUserSelect(params) {
  return request({
    url: 'API/Class/GetClassUserSelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 检验校对树
 * @param {Array} Search 
 */
export function getCheckBatchIdSelect(params) {
  return request({
    url: 'API/QualityTest/GetCheckBatchIdSelect',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean
  })
}

/**
 * 检验校对 报告列表
 * @param {Object} data 
 */
export function selectTestReports(params) {
  return request({
    url: 'API/QualityReport/SelectTestReports',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean 
  })
}

/**
 * 检验校对 检验项目列表
 * @param {Object} data 
 */
export function getCheckTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetCheckTestAttributes',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean 
  })
}

/**
 * 检验校对 历史列表
 * @param {Object} data 
 */
export function getExistCheckTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetExistCheckTestAttributes',
    method: 'get',
    params,
    successMsg: false, //请求成功通知，支持String & Boolean
    failMsg: true //请求失败通知，支持String & Boolean 
  })
}

/**
 * 检验修改 树
 * @param {Object} data 
 */
export function getModifyBatchIdSelect(params) {
  return request({
    url: 'API/QualityTest/GetModifyBatchIdSelect',
    method: 'get',
    params,
    // successMsg: false, //请求成功通知，支持String & Boolean
    // failMsg: true //请求失败通知，支持String & Boolean 
  })
}

/**
 * 检验修改 校对信息
 * @param {Object} data 
 */
export function getCheckRecord(params) {
  return request({
    url: 'API/QualityTest/GetCheckRecord',
    method: 'get',
    params,
    // successMsg: false, //请求成功通知，支持String & Boolean
    // failMsg: true //请求失败通知，支持String & Boolean 
  })
}


/**
 * 批号接口
 * @param {Object} data 
 */
export function getBatchIds(params) {
  return request({
    url: 'API/QualityAnalysis/GetBatchIds',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}


/**
 * 
 * @param {Object} data 
 */
export function getStandardItem(params) {
  return request({
    url: 'API/QualityStandard/GetTestStandardAttributeSelect',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}


/**
 * 
 * @param {Object} data 
 */
export function getExtraRecords(params) {
  return request({
    url: 'API/QualityTest/GetExtraRecords',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 检验修改 项目列表
 * @param {Object} data 
 */
export function getModifyTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetModifyTestAttributes',
    method: 'get',
    params,
    // successMsg: false, //请求成功通知，支持String & Boolean
    // failMsg: true //请求失败通知，支持String & Boolean 
  })
}

/**
 * 检验审批项目列表
 * @param {Object} data 
 */
export function getApproveTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetApproveTestAttributes',
    method: 'get',
    params,
    // successMsg: false, //请求成功通知，支持String & Boolean
    // failMsg: true //请求失败通知，支持String & Boolean 
  })
}

/**
 * 树
 * @param {Object} data 
 */
export function GetAreaTree(params) {
  return request({
    url: 'API/BaseData/GetAreaTree',
    method: 'get',
    params,
    // successMsg: true,
    // failMsg: true
  })
}

/**
 * 采样点
 * @param {Object} data 
 */
export function GetSampleAttributePage(params) {
  return request({
    url: 'API/QualitySample/GetSampleAttributePage',
    method: 'get',
    params,
    // successMsg: true,
    // failMsg: true
  })
}

/**
 * 保存产品请检
 * @param {Object} data 
 */
export function addApply(data) {
  return request({
    url: 'API/QualityTest/AddApply',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 加测内容 保存
 * @param {Object} data 
 */
export function AddExtraApply(data) {
  return request({
    url: 'API/QualityTest/AddExtraApply',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 保存产品请检
 * @param {Object} data 
 */
export function saveModifyTest(data) {
  return request({
    url: 'API/QualityTest/SaveModifyTest',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 检验校对 报告预览1
 * @param {Object} data 
 */
export function saveReportAttributes(data) {
  return request({
    url: 'API/QualityTest/SaveReportAttributes',
    method: 'post',
    data,
    // successMsg: true,
    failMsg: true
  })
}

/**
 * 检验校对 报告预览2
 * @param {Object} data 
 */
export function previewTestReport(data) {
  return request({
    url: 'API/QualityReport/PreviewTestReport',
    method: 'post',
    data,
    // successMsg: true,
    failMsg: true
  })
}


/**检验校对保存 
 * @param {Object} data 
 */
export function saveCheckTest(data) {
  return request({
    url: 'API/QualityTest/SaveCheckTest',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 确认领用
 * @param {Object} data 
 */
export function saveTestSampleInfo(data) {
  return request({
    url: 'API/RetainedSample/SaveTestSampleInfo',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 检验分配保存
 * @param {Object} data 
 */
export function saveTestAttributes(data) {
  return request({
    url: 'API/QualityTest/SaveTestAttributes',
    method: 'post',
    data,
    // successMsg: true,
    // failMsg: true
  })
}

/**
 * 检验分配撤回
 * @param {Object} data 
 */
export function callBackTestAttributes(data) {
  return request({
    url: 'API/QualityTest/CallBackTestAttributes',
    method: 'post',
    data,
    // successMsg: true,
    // failMsg: true
  })
}




/**
 * s树
 * @param {Object} data 
 */
export function getDepartmentListByTree(data) {
  return request({
    url: 'API/UserInfo/GetDepartmentListByTree',
    method: 'post',
    data,
    // successMsg: true,
    // failMsg: true
  })
}



/**
 * pdf
 * @param {Object} data 
 */
export function getApplyTicket(data) {
  return request({
    url: 'API/QualityTest/GetApplyTicket',
    method: 'post',
    data,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 驳回请求
 * @param {Object} data 
 */
export function rejectSampleData(data) {
  return request({
    url: 'API/QualityTest/RejectSampleData',
    method: 'post',
    data,
    // successMsg: true,
    // failMsg: true
  })
}

/**
 * 保存稳定性
 * @param {Object} data 
 */
export function addStabilitySampleUse(data) {
  return request({
    url: 'API/RetainedSample/AddStabilitySampleUse',
    method: 'post',
    data,
    // successMsg: true,
    // failMsg: true
  })
}

/**
 * 保存分样
 * @param {Object} data 
 */
export function saveSampleData(data) {
  return request({
    url: 'API/QualityTest/SaveSampleData',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 保存分样
 * @param {Object} data 
 */
export function saveUserTestAttributes(data) {
  return request({
    url: 'API/QualityTest/SaveUserTestAttributes',
    method: 'post',
    data,
    // successMsg: true,
    // failMsg: true
  })
}

/**
 * 检验审批
 * @param {Object} data 
 */
export function saveApproveTest(data) {
  return request({
    url: 'API/QualityTest/SaveApproveTest',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 批号接口
 * @param {Object} data 
 */
export function getMaterialReportData(params) {
  return request({
    url: 'API/RecordReport/GetMaterialReportData',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 接口
 * @param {Object} data 
 */
export function GetRecordEquipmentPage(params) {
  return request({
    url: 'API/DeviceInfo/GetRecordEquipmentPage',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}
/**
 * 接口
 * @param {Object} data 
 */
export function GetAttributesByMaterialCode(params) {
  return request({
    url: 'API/QualityAttribute/GetAttributesByMaterialCode',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 记录添加
 * @param {Object} data 
 */
export function AddUserRecord(data) {
  return request({
    url: 'API/DeviceInfo/AddUserRecord',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}
// 
/**
 * 接口
 * @param {Object} data 
 */
export function GetUserRecordPage(params) {
  return request({
    url: 'API/DeviceInfo/GetUserRecordPage',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 
 * @param {Object} data 
 */
export function RetunUserRecord(data) {
  return request({
    url: 'API/DeviceInfo/RetunUserRecordv2',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 接口
 * @param {Object} data 
 */
export function GetMateriaLeffectivedateByCodeStandard(params) {
  return request({
    url: 'API/MaterialInfo/GetMateriaLeffectivedateByCodeStandard',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 接口
 * @param {Object} data 
 */
export function getReTestTreeByMaterialType(params) {
  return request({
    url: 'API/QualityTest/GetReTestTreeByMaterialType',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 通过驳回
 * @param {Object} data 
 */
export function saveReApproveTest(data) {
  return request({
    url: 'API/QualityTest/SaveReApproveTest',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 加测申请查询
 * @param {Object} data 
 */
export function GetAddTestList(params) {
  return request({
    url: 'API/QualityTest/GetAddTestList',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 新增加测申请
 * @param {Object} data 
 */
export function CreateOrUpdateAddTest(data) {
  return request({
    url: 'API/QualityTest/CreateOrUpdateAddTest',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 判断是否添加
 * @param {Object} data 
 */
export function GetAddButtonPower(params) {
  return request({
    url: 'API/QualityTest/GetAddButtonPower',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 撤回信息
 * @param {Object} data 
 */
export function BatchOperateAddTestByIds(data) {
  return request({
    url: 'API/QualityTest/BatchOperateAddTestByIds',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 获取检验项目
 * @param {Object} data 
 */
export function GetExtraTestAttributes(params) {
  return request({
    url: 'API/QualityTest/GetExtraTestAttributes',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 保存
 * @param {Object} data 
 */
export function SaveReportAttributes(data) {
  return request({
    url: 'API/QualityTest/SaveReportAttributes',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 待我检验单条数据查询
 * @param {Object} data 
 */
export function GetSampleRecordHeadById(params) {
  return request({
    url: 'API/QualityTest/GetSampleRecordHeadById',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}
// 
/**
 * 规格
 * @param {Object} data 
 */
export function GetSampleSpecificationSelect(params) {
  return request({
    url: 'API/QualityTest/GetSampleSpecificationSelect',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  })
}

/**
 * 保存
 * @param {Object} data 
 */
export function SaveStabilitySampleData(data) {
  return request({
    url: 'API/QualityTest/SaveStabilitySampleData',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 获取分样树
 * @param {Object} data 
 */
export function GetTestShareTree(params) {
  return request({
    url: 'API/QualityTest/GetTestShareTree',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}

/**
 * 是否显示确认取样单 按钮
 * @param {Object} data 
 */
export function GetPrintDownLoadByIautoid(params) {
  return request({
    url: 'API/BaseData/GetPrintDownLoadByIautoid',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}

/**
 * 样品确认
 * @param {Object} data 
 */
export function CommonPrintDownLoad(data) {
  return request({
    url: 'API/BaseData/CommonPrintDownLoad',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 样品分样帮助
 * @param {Object} data 
 */
export function GetSampleShareAttributes(params) {
  return request({
    url: 'API/RetainedSample/GetSampleShareAttributes',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}



/**
 * 班组查询
 * @param {Object} data 
 */
export function GetClassSelectByTestID(params) {
  return request({
    url: 'API/RetainedSample/GetClassSelectByTestID',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}

// API/QualityTest/GetAllocationMember
/**
 * 班组查询
 * @param {Object} data 
 */
export function GetAllocationMember(data) {
  return request({
    url: 'API/QualityTest/GetAllocationMember',
    method: 'post',
    data,
    successMsg: true,
    failMsg: true
  })
}

/**
 * 保存pdf结论
 * @param {Object} data 
 */
export function SaveCheckTestResult(data) {
  return request({
    url: 'API/QualityTest/SaveCheckTestResult',
    method: 'post',
    data,
    successMsg: false,
    failMsg: true
  })
}


/**
 * 
 * @param {Object} data 
 */
export function GetTestDate(params) {
  return request({
    url: 'API/OOSOOTFlow/GetTestDate',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}

/**
 * 
 * @param {Object} data 
 */
export function GetAttributeValue(params) {
  return request({
    url: 'API/QualityTest/GetAttributeValue',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}

/**
 * 
 * @param {Object} data 
 */
export function GetQuoteBatchIdsThree(params) {
  return request({
    url: 'API/QualityAnalysis/GetQuoteBatchIdsThree',
    method: 'get',
    params,
    successMsg: false,
    failMsg: false
  })
}

/**
 * 获取检验pdf
 * @param {Object} data
 */
export function PreviewElectronicRecordReport(params) {
  return request({
    url: 'API/RecordReport/PreviewElectronicRecordReport',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  });
}

/**
 * 检验复核
 * @param {Object} data
 */
export function SaveRecordApprove(params) {
  return request({
    url: 'API/RecordReport/SaveRecordApprove',
    method: 'get',
    params,
    successMsg: true,
    failMsg: true
  });
}

//
/**
 * 获取检验复检 树
 * @param {Object} data
 */
export function GetRecordApproveTree(params) {
  return request({
    url: 'API/RecordReport/GetRecordApproveTree',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  });
}

//
/**
 * 获取检验数据
 * @param {Object} data
 */
export function GetRecordApproveAttributes(params) {
  return request({
    url: 'API/RecordAttribute/GetRecordApproveAttributes',
    method: 'get',
    params,
    successMsg: false,
    failMsg: true
  });
}

// 撤回检验项目
export function RevocationRecordApprove(data) {
  return request({
    url: 'API/RecordReport/RevocationRecordApprove',
    method: 'post',
    data,
    successMsg: false,
    failMsg: true
  });
}

// 检验校对驳回
export function RejectCheckTest(data) {
	return request({
    url: 'API/QualityTest/RejectCheckTest',
    method: 'post',
    data,
    successMsg: false,
    failMsg: true
  });
}

export function SelectTestProjectDataTwo(params) {
	return request({
		url: 'api/ApparatusProject/SelectTestProjectDataTwo',
		method: 'get',
		params,
		successMsg: false,
		failMsg: false
	});
}

// 其他引用查询
export function GetCiteOtherAttributeValue(params) {
	return request({
		url: 'API/QualityTest/GetCiteOtherAttributeValue',
		method: 'get',
		params,
		successMsg: false,
		failMsg: false
	});
}